1. Field of the Invention
This invention relates generally to disk drives, and more particularly to a magnetic recording disk drive that includes a nonvolatile memory.
2. Description of the Related Art
Magnetic recording hard disk drives (HDDs) typically include, in addition to the rotating disk memory, dynamic random access memory (DRAM), a volatile form of memory that can undergo a significant number of write/erase cycles and that has a high data transfer rate. The DRAM functions as “cache” to temporarily hold user data transferred between the host computer and the disks. The disk drive's data controller receives read and write commands from the host computer and controls the writing of user data to the disks and the reading of user data from the disks. In one common method for the transfer of write data to the DRAM, called “write-back caching” or “write-cache enabled”, the write data for a write command from the host is stored in DRAM, write completion is signaled to the host when the write data has been received in the DRAM, and the write data in DRAM is then some time later destaged from the DRAM and written to the disks.
With the advent of mobile computers that are battery powered, some HDDs have a “power-save” or “stand-by” mode wherein the spindle motor that supports the disks spins down (stops rotating) when the disk drive has been inactive for a period of time. The main purpose of this mode is to extend the battery life of the mobile computer. When a disk drive is in standby mode, with just the electronics active, battery power is conserved. When write data is received from the host and must be written to the disks, the disk drive exits standby mode and the disks spin up to enable the write data to be written, which consumes a significant amount of battery power. If this occurs too frequently, there is no power saving.
One solution to this problem is to store the write data in the DRAM when the drive is in standby mode and the disks are not rotating, and then destage the write data to the disks at some later time, as in write-cache enabled. However, because DRAM is volatile memory, there is a risk that the write data in the DRAM can be lost if the drive loses power before the write data can be destaged to the disks. Thus it has been proposed to use nonvolatile memory, e.g., “flash” memory, in addition to or in place of DRAM in HDDs used in mobile computers. Because flash memory is nonvolatile, the write data will not be lost if power is lost. This type of HDD is sometimes called a “hybrid” disk drive because it contains two types of “permanent” data storage media, i.e., the nonvolatile memory and the magnetic recording disks. Hybrid HDDs use their flash memory for this mode of operation, i.e., the power-save mode. Thus the primary advantage of a hybrid disk drive is the ability to receive write data from the host without having to exit the standby mode, thereby conserving power and extending battery life, but without any risk of losing data in the event of a power failure.
HDDs often include diagnostic programs or routines to monitor HDD reliability-related parameters that may indicate real or potential HDD failure events. Failure-related data associated with these events are recorded on the disks in reserved areas not used for user data. Examples of HDD parameters that may be monitored for the detection of a failure event include HDD temperature, frequency of read and/or write errors, head-disk spacing, and time required for the spindle motor to spin-up the disks. If a failed HDD is returned to the manufacturer, the recorded failure data can be examined to determine the cause of failure. However, if the failure mode is such that data cannot be written to the disk, then failure information cannot be recorded. Also, if the HDD spindle motor can not spin-up or data can not be read from the disks, then retrieving the failure data from the reserved areas of the disks becomes difficult or impossible.
One special type of failure event is a defective data sector. Each of the concentric data tracks in an HDD is divided into contiguous physical sectors where the data is stored, with each physical sector being associated with a logical block address (LBA). Defective sectors can be detected by running a diagnostic routine or by a defect management routine that is part of the HDD's read/write process. When a new defective sector is detected after the HDD has been put into operation (called a “grown defect”), that defective sector is taken out of service and its associated LBA is mapped to a reallocated or spare sector in a reserved area of the disk, typically at the end of a data track. However, because the spare sector is not physically contiguous with the physical sectors of the immediately preceding and succeeding LBAs, a read or write command for an LBA range that includes the defective sector's LBA will require the disk drive to seek (i.e., move the read/write head from one track to another track) to access the spare sector while processing the command, and then do another seek back to continue with the processing of the command. These two extra seeks, plus the accompanying rotational latency (i.e., the time for a sector to rotate beneath the read/write head after the head is on the track), significantly degrades the performance of any data access that involves grown defects. In addition to degraded performance, the use of spare sectors requires reserved areas on the disks, which decreases the disk area available for user data.
What is needed is a hybrid disk drive that does not suffer from the problems associated with the recording of failure events, and does not have the performance degradation associated with the handling of defective data sectors.